[PATCH 26/26] libblkid: iso9660: allocate enough space for UTF16 decoding
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 10 Nov 2022 18:48:20 +0000 (19:48 +0100)
committerChris Hofstaedtler <zeha@debian.org>
Mon, 13 Feb 2023 08:48:21 +0000 (08:48 +0000)
commit01b788328f8f2c6ee1d9f84abb8a3abe7c2fd197
treee5c81dfd6c22abe4f8527998f409c4bd19fbdb38
parent1270032bcb7de3a8daa0dd24eadc461e328d7ab3
[PATCH 26/26] libblkid: iso9660: allocate enough space for UTF16 decoding

When merge_utf16be_ascii() encounters high-codepoint surrogate pairs it
emits four bytes of output for one byte of ascii input.
In addition with the remaining ascii characters from the second loop we
need up to 5 * sizeof(input) / 2 bytes as output buffer.

As we decode up to 128 ascii characters with merge_utf16be_ascii() we
need 320 bytes of buffer available.

Furthermore adapt merge_utf16be_ascii() to not write paste the output
buffer end.

Fix OSS-Fuzz issue 53149 ( #1887 )

Gbp-Pq: Topic upstream
Gbp-Pq: Name 0026-libblkid-iso9660-allocate-enough-space-for-UTF16-dec.patch
libblkid/src/superblocks/iso9660.c